package com.zzj.ecology.system.service.impl;

import com.zzj.ecology.system.dto.HttpResult;
import com.zzj.ecology.system.domain.Page;

/**
 * @ClassName BaseService
 * @Description TODO
 * @Author zhijun zeng at 12:58 2020/3/31
 * @Version 1.0
 **/
public class BaseService {

    // 查询数据
    protected HttpResult responseSuccessPageData(Page page){
        return HttpResult.success().add(HttpResult.PAGE_TAG, page);
    }

    // 插入更新数据
    protected HttpResult responseDataResult(int i, Object successObj, Object errorObj) {
        return i > 0 ? HttpResult.success().add(HttpResult.DATA_TAG, successObj) : HttpResult.error().add(HttpResult.DATA_TAG, errorObj);
    }


}
